#include <ros/ros.h>
#include "socket_manager.h"

int main(int argc, char * argv[])
{
    ros::init(argc, argv, "communication_node");

    ros::NodeHandle nh;
    ros::NodeHandle private_nh("~");
#if 1
    std::string ipaddress("127.0.0.1");
    unsigned short port = 9090;

    Communication::SocketManger socket_(nh, private_nh, ipaddress, port);
    socket_.Start();
#else
    ros::Time t1(0.0f);
    ros::Time t2 = t1 - ros::Duration(5.0f);
    
    std::cout << t1.sec << "  " << t1.nsec << std::endl;
    // std::cout << t2.sec << "  " << t2.nsec << std::endl;
    // std::cout << (ros::Time::now() - ros::Duration(5.0f)).toSec() << std::endl;
#endif
    ros::spin();
    ros::shutdown();
    return 0;
}
